-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update trigger_observers
to operate over slices of data
#14354
Conversation
@alice-i-cecile does this look correct to you to fix the issue? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't comment on whether the underlying issue makes sense as I'm out of the loop, but this implementation fits the required specification perfectly.
@@ -842,11 +838,11 @@ impl<'w> BundleInserter<'w> { | |||
unsafe { | |||
deferred_world.trigger_on_add(new_archetype, entity, add_bundle.added.iter().cloned()); | |||
if new_archetype.has_add_observer() { | |||
deferred_world.trigger_observers(ON_ADD, entity, add_bundle.added.iter().cloned()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the change we're looking for :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alice-i-cecile @NthTensor Now curious about trigger_on_add
and trigger_on_insert
, should these get the same treatment? I also didn't have full context around the "whys" so maybe there's a reason to just apply it to specific methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you :)
Thank you for picking this up! Looks great. |
Objective
trigger_observers
should operate on slices of data #14333Solution
trigger_observers
signature to operate over a slice instead of anIterator
.trigger_observers
to match the new signature.Migration Guide